import java.util.*;

public class Main {

  public Main() {
    Shape s1 = new Circle(5);
    Shape s2 = new Rect( 4, 5 );
    Shape s3 = new Triangle( 5,10 );

    ArrayList<Shape> list = new ArrayList<Shape>();
    list.add(s1);
    list.add(s2);
    list.add(s3);

    Iterator iterator = list.iterator();

    while (iterator.hasNext()) {
      Shape shape = (Shape)iterator.next();
      shape.printArea();
    }
  }
  
  public static void main( String[] args ){
    Main main = new Main();
  }
}

